<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>字面量写法</title>
	<body>
		<script type="text/javascript">
			
			const id = 1;
			const name = "tomcat猫";
			const age = 100;
			
			//可以通过改方法 直接定义对象
			const user = {
				id,
				name,
				age
			}
			
			console.log(user);
			
			
			//2.ES6定义函数的方法
			const methods = {
				eat : function(){
					
				},
				hello() {
					
				}
			}
			
		</script>
		
	</body>
</html>
